<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        body{
            margin: 0;
            padding: 0;
            overflow: hidden;
        }
        .box1,.box2{
            width: 300px;
            height: 300px;
            background-color: pink;
            margin: 50px auto;
            cursor: pointer;
        }
    </style>
</head>
<body>
<div class = box1></div>
<div class = box2></div>
<script>
    let box1 = document.querySelector(".box1")
    let box2 = document.querySelector(".box2")

    box1.onclick = function foo1(){
        box2.innerHTML += "云牧真帅"
    }
    box2.onclick = function foo1(){
        box1.innerHTML += "帅的不谈"
    }


</script>
</body>
</html>